<!DOCTYPE html>
<html>
<head>
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d890b1f16fb364253e79c5bb20225c3a";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>


    

    

    
<!-- Baidu Tongji -->
<script>var _hmt = _hmt || []</script>
<script async src="//hm.baidu.com/hm.js?busuanzi_value_site_uv"></script>
<!-- End Baidu Tongji -->




    <meta charset="utf-8">
    <meta name="baidu-site-verification" content="FYMCShbUK8" />
    <meta name="baidu-site-verification" content="ZYRF7OxQRW" />
    <meta name="baidu-site-verification" content="cHSqtjI0PN" />
    <meta name="baidu-site-verification" content="cHSqtjI0PN" />
    <meta name="baidu-site-verification" content="cHSqtjI0PN" />
    
    
    <link rel="canonical" href="https://hhardyy.com/2019/08/22/从无到有跑一个react-native/">
    
    
    <title>react-native | 小方块 - hhardyy.com | 复杂的坑+归其原理+了解实现规则===解决？解决成功：加油解决成功;</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#958e93">
    
    
    <meta name="keywords" content="react-native,Node,Python2,JDK,Android Studio">
    <meta name="description" content="因为最近老大突然提到了原生app开发，所以我。。。">
<meta name="keywords" content="react-native,Node,Python2,JDK,Android Studio">
<meta property="og:type" content="article">
<meta property="og:title" content="react-native">
<meta property="og:url" content="http://yoursite.com/2019/08/22/从无到有跑一个react-native/index.html">
<meta property="og:site_name" content="小方块 - hhardyy.com">
<meta property="og:description" content="因为最近老大突然提到了原生app开发，所以我。。。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://yoursite.com/images/rn/11.png">
<meta property="og:image" content="http://yoursite.com/images/rn/1.png">
<meta property="og:image" content="http://yoursite.com/images/rn/2.png">
<meta property="og:image" content="http://yoursite.com/images/rn/2.jpg">
<meta property="og:image" content="http://yoursite.com/images/rn/code1.png">
<meta property="og:image" content="http://yoursite.com/images/rn/code2.png">
<meta property="og:image" content="http://yoursite.com/images/rn/code3.png">
<meta property="og:image" content="http://yoursite.com/images/rn/reset.png">
<meta property="og:image" content="http://yoursite.com/images/rn/end.png">
<meta property="og:updated_time" content="2020-01-13T15:29:13.895Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="react-native">
<meta name="twitter:description" content="因为最近老大突然提到了原生app开发，所以我。。。">
<meta name="twitter:image" content="http://yoursite.com/images/rn/11.png">
    
        <link rel="alternate" type="application/atom+xml" title="小方块 - hhardyy.com" href="/atom.xml">
    
    <link rel="shortcut icon" href="/hardyfavicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/paulGraham.jpg)">
      <div class="brand" style="background-color:#4154b2">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">BingZhenhuang</h5>
          <a href="mailto:huangbingzhen@hhardyy.com" title="huangbingzhen@hhardyy.com" class="mail">huangbingzhen@hhardyy.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                所有文章
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/HHardyy" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://gitee.com/hhardyy" target="_blank" >
                <i class="icon icon-lg icon-cloud"></i>
                Gitee
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://juejin.im/user/59a26f926fb9a02487553b04"  >
                <i class="icon icon-lg icon-pencil"></i>
                掘金-圳
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://segmentfault.com/u/hhardyy"  >
                <i class="icon icon-lg icon-comments"></i>
                Segmentfault
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://codepen.io/HHardyy/" target="_blank" >
                <i class="icon icon-lg icon-codepen"></i>
                Codepen
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://www.freecodecamp.cn/hhardyy" target="_blank" >
                <i class="icon icon-lg icon-leaf"></i>
                Freecodecamp
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/友情链接"  >
                <i class="icon icon-lg icon-link"></i>
                友链
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">react-native</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">react-native</h1>
        <h5 class="subtitle">
            
                <time datetime="2019-08-22T14:30:39.000Z" itemprop="datePublished" class="page-time">
  2019-08-22
</time>


            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#开发的平台"><span class="post-toc-number">1.</span> <span class="post-toc-text">开发的平台</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#环境搭建"><span class="post-toc-number">2.</span> <span class="post-toc-text">环境搭建</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#必须安装的依赖"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">必须安装的依赖</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#Android开发环境"><span class="post-toc-number">2.2.</span> <span class="post-toc-text">Android开发环境</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#安装-Android-SDK"><span class="post-toc-number">2.3.</span> <span class="post-toc-text">安装 Android SDK</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#配置系统环境变量"><span class="post-toc-number">2.4.</span> <span class="post-toc-text">配置系统环境变量</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#platform-tools目录添加到环境变量Path中"><span class="post-toc-number">2.5.</span> <span class="post-toc-text">platform-tools目录添加到环境变量Path中</span></a></li></ol></li></ol>
        </nav>
    </aside>
    
<article id="post-从无到有跑一个react-native"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">react-native</h1>
        <div class="post-meta">
            <time class="post-time" title="2019-08-22 22:30:39" datetime="2019-08-22T14:30:39.000Z"  itemprop="datePublished">2019-08-22</time>

            


            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>因为最近老大突然提到了原生app开发，所以我。。。</p>
<p><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/player?type=2&id=28535311&auto=0&height=66"></iframe><br><a id="more"></a></p>
<p>所以我想到了react-native、flutter当然还有uni-app，当然这些写出来的app不能直接和原生比，而是只是接近原生的渲染机制，我和一个做了几年安卓原生的前辈交谈过，他认为这种机制更偏向于做一些数据渲染的应用，如果太多动画的话是跟不上原生安卓的体验的。</p>
<p>在做任何东西之前，先要搭建环境，即使是强无敌的jquery也要先下载jquery源码或者去BootSDN等引外链</p>
<h3 id="开发的平台"><a href="#开发的平台" class="headerlink" title="开发的平台"></a>开发的平台</h3><p>macOS || Windows || Linux =&gt; iOS || Android</p>
<h3 id="环境搭建"><a href="#环境搭建" class="headerlink" title="环境搭建"></a>环境搭建</h3><p>搭建之前温馨提示几点：<br>1、需要全程保持“科学上网”，否则能ERROR或者跳网址到你怀疑人生<br>2、因为环境需要，npm的镜像可以设置成淘宝的镜像，否则还是要依赖“科学上网工具”<br>3、不要使用 cnpm！cnpm 安装的模块路径比较奇怪，packager 不能正常识别！<br>4、Node的版本必须大于等于10<br>5、Python的版本必须为 2.x（不支持 3.x）<br>6、JDK的版本必须是1.8（我用的1.7，目前不支持 1.9 及更高版本）。</p>
<h4 id="必须安装的依赖"><a href="#必须安装的依赖" class="headerlink" title="必须安装的依赖"></a>必须安装的依赖</h4><p>有：Node、React Native命令行工具、Python2 以及JDK和Android Studio（虽然你可以使用任何编辑器来开发应用，但你仍然必须安装 Android Studio来获得编译 Android 应用所需的工具和环境。）</p>
<p>Node安装是每个前端的标配（略），安装完成后用node -v查看版本号</p>
<p>Yarn是Facebook提供的替代npm的工具，可以加速node模块的下载。React Native的命令行工具用于执行创建、初始化、更新项目、运行打包服务（packager）等任务。安装命令：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install -g yarn react-native-cli</div></pre></td></tr></table></figure></p>
<p>yarn的镜像也可以设置成淘宝镜像<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">yarn config set registry https:<span class="comment">//registry.npm.taobao.org --global</span></div><div class="line">yarn config set disturl https:<span class="comment">//npm.taobao.org/dist --global</span></div></pre></td></tr></table></figure></p>
<h4 id="Android开发环境"><a href="#Android开发环境" class="headerlink" title="Android开发环境"></a>Android开发环境</h4><blockquote>
<p>请注意！！！国内用户必须必须必须有稳定的翻墙工具，否则在下载、安装、配置过程中会不断遭遇链接超时或断开，无法进行开发工作。某些翻墙工具可能只提供浏览器的代理功能，或只针对特定网站代理等等，请自行研究配置或更换其他软件。总之如果报错中出现有网址，那么 99% 就是无法正常翻墙。</p>
</blockquote>
<p><a href="https://developer.android.com/studio/index.html" target="_blank" rel="external">安装Android Studio</a>,如果科学上网不了的话，即使有安装包安装过程也极大概率出问题，所以这一步先科学上网再继续<br><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">安装界面中选择<span class="string">"Custom"</span>选项，确保选中了以下几项：</div><div class="line">Android SDK</div><div class="line">Android SDK Platform</div><div class="line">Performance (Intel ® HAXM) </div><div class="line">Android Virtual Device</div></pre></td></tr></table></figure></p>
<p>然后点击”Next”来安装选中的组件。(如果选择框是灰的，你也可以先跳过，稍后再来安装这些组件。),看到欢迎界面就是安装完成了，然后继续下一步</p>
<h4 id="安装-Android-SDK"><a href="#安装-Android-SDK" class="headerlink" title="安装 Android SDK"></a>安装 Android SDK</h4><blockquote>
<p>Android Studio默认会安装最新版本的Android SDK。目前编译React Native应用需要的是Android 9(Pie)版本的SDK（注意 SDK 版本不等于终端系统版本，RN目前支持android4.1 以上设备）。你可以在Android Studio的 SDK Manager中选择安装各版本的SDK。</p>
</blockquote>
<p>在上面那一步安裝完成的Android Studio的欢迎界面中找到SDK Manager。点击”Configure”，然后就能看到”SDK Manager”。（SDK Manager还可以在Android Studio 的”Preferences”菜单中找到。具体路径是Appearance &amp; Behavior → System Settings → Android SDK。）</p>
<p>在SDK Manager中选择”SDK Platforms”选项卡，然后在右下角勾选”Show Package Details”。展开Android 9 (Pie)选项，确保勾选了下面这些组件（再次提醒你需要科学上网工具，否则看不到接下来的界面）：<br><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">Android SDK Platform <span class="number">28</span></div><div class="line">Intel x86 Atom_64 System Image（官方模拟器镜像文件，使用非官方模拟器不需要安装此组件）</div></pre></td></tr></table></figure></p>
<p>然后点击”SDK Tools”选项卡，同样勾中右下角的”Show Package Details”。展开”Android SDK Build-Tools”选项，确保选中了React Native 所必须的28.0.3版本。你可以同时安装多个其他版本。</p>
<p>最后点击”Apply”来下载和安装这些组件。</p>
<h4 id="配置系统环境变量"><a href="#配置系统环境变量" class="headerlink" title="配置系统环境变量"></a>配置系统环境变量</h4><blockquote>
<p>React Native 需要通过环境变量来了解你的 Android SDK 装在什么路径，从而正常进行编译。</p>
</blockquote>
<p>在系统的环境变量创建一个名为ANDROID_HOME的环境变量（用户变量也可以），指向你的Android SDK所在的目录，也就是C:\你的电脑用户名\AppData\Local\Android\Sdk，这是Android Sdk默认的安装目录（不信的话可以在Android Studio的”Preferences”菜单中查看SDK的路径，具体是Appearance &amp; Behavior → System Settings → Android SDK。弄好之后关闭当前的命令行工具重新打开，新配置的环境变量才生效</p>
<h4 id="platform-tools目录添加到环境变量Path中"><a href="#platform-tools目录添加到环境变量Path中" class="headerlink" title="platform-tools目录添加到环境变量Path中"></a>platform-tools目录添加到环境变量Path中</h4><p>这个目录默认的路径是c:\Users\你的用户名\AppData\Local\Android\Sdk\platform-tools</p>
<p>做好了上面这些，接下来就可以开始你想做的了，就是建个项目跑一跑，其实只要上面的那些环境建好了，接下来的步骤都比较顺畅<br>创建一个react-native的项目<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">react-native init AwesomeProject</div></pre></td></tr></table></figure></p>
<blockquote>
<p>可以使用–version参数（注意是两个杠）创建指定版本的项目。例如react-native init MyApp –version 0.44.3。注意版本号必须精确到两个小数点。Windows 用户请注意，请不要在某些权限敏感的目录例如 System32 目录中 init 项目！会有各种权限限制导致不能运行！</p>
</blockquote>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/11.png" alt="建好的目录结构是这样的" title="">
                </div>
                <div class="image-caption">建好的目录结构是这样的</div>
            </figure>
<p>创建好项目之后就可以运行了，运行的顺序也很讲究<br>1、启动Android Studio打开项目文件下面的android下面的app，然后Create Virtual Device创建一台虚拟安卓设备，然后开机<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/1.png" alt="Android Studio" title="">
                </div>
                <div class="image-caption">Android Studio</div>
            </figure><br>2、打开了安卓虚拟设备之后启动项目<br><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">cd AwesomeProject</div><div class="line">react-<span class="keyword">native</span> run-android</div></pre></td></tr></table></figure></p>
<p>如果配置没有问题，你应该可以看到应用自动安装到设备上并开始运行。第一次运行时需要下载大量编译依赖，耗时比较久。此过程严重依赖稳定的翻墙工具，否则将频繁遭遇链接超时和断开，导致无法运行。</p>
<p>如果运行之后安卓设备打开的界面是爆红的错误，请执行一个npm install将缺失的一些依赖安装上，然后执行react-native start启动项目<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/2.png" alt="start" title="">
                </div>
                <div class="image-caption">start</div>
            </figure><br>然后在Android Studio上点击编译并执行的绿色三角按钮，将app跑起来<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/2.jpg" alt="run" title="">
                </div>
                <div class="image-caption">run</div>
            </figure></p>
<p>那项目跑起来之后如何去修改里面的程序，写成自己想要的呢，其实和react一样，它的入口组件也是App.js,简单举个例子，我们改掉里面的小部分内容，其他就保留原样展示<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/code1.png" alt="code1" title="">
                </div>
                <div class="image-caption">code1</div>
            </figure><br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/code2.png" alt="code2" title="">
                </div>
                <div class="image-caption">code2</div>
            </figure><br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/code3.png" alt="code3" title="">
                </div>
                <div class="image-caption">code3</div>
            </figure><br>代码改动之后，重新编译然后启动发现app界面的内容没有变化的话，你可能会运行react-native run-android，让它重新打包，接着再react-native start启动，然后发现，App界面还是没有更新。这时候可以执行一下这个命令再启动项目<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">react-native bundle --platform android --dev <span class="literal">false</span> --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/</div></pre></td></tr></table></figure></p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/reset.png" alt="也就是这样" title="">
                </div>
                <div class="image-caption">也就是这样</div>
            </figure>
<p>如果有index.android.js，那么可以这样做：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">react-native bundle --platform android --dev <span class="literal">false</span> --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/</div></pre></td></tr></table></figure></p>
<p>之后再运行react-native start，修改的内容就更新了<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/rn/end.png" alt="App" title="">
                </div>
                <div class="image-caption">App</div>
            </figure><br>最后再解释一下这个项目的目录结构</p>
<table>
<thead>
<tr>
<th>名称</th>
<th style="text-align:center">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>android</td>
<td style="text-align:center">Android项目目录，包含了使用AndroidStudio开发项目的环境配置文件</td>
</tr>
<tr>
<td>ios</td>
<td style="text-align:center">iOS项目目录，包含了XCode的环境</td>
</tr>
<tr>
<td>node_modules</td>
<td style="text-align:center">基于node文件依赖系统产生的相关依赖和第三方lib</td>
</tr>
<tr>
<td>index.js</td>
<td style="text-align:center">ios或android的入口，已经使用index.js代替index.ios.js/index.android.js，android中配置application文件的getJSMainModuleName()配置入口</td>
</tr>
<tr>
<td>app.json</td>
<td style="text-align:center">app的json文件</td>
</tr>
<tr>
<td>package.json</td>
<td style="text-align:center">项目基本信息以及依赖信息</td>
</tr>
<tr>
<td>package-lock.json</td>
<td style="text-align:center">npm install生成的文件，记录当前npm package的信息</td>
</tr>
<tr>
<td>App.js</td>
<td style="text-align:center">相当于Android的MainActivity，可以根据自己的需要进行修改或者删除（同时要修改index.js的注册的组件入口js文件名）</td>
</tr>
<tr>
<td>.babelrc</td>
<td style="text-align:center">Babel配置文件，在.babelrc配置文件中，主要是对预设（presets）和插件（plugins）进行配置，因此不同的转译器作用不同的配置项</td>
</tr>
<tr>
<td>.buckconfig</td>
<td style="text-align:center">Buck的配置文件，buck是Facebook开源的高效构建系统</td>
</tr>
<tr>
<td>.flowconfig</td>
<td style="text-align:center">Flow的配置文件，flowconfig是是Flow的配置文件</td>
</tr>
<tr>
<td>.gitattributes</td>
<td style="text-align:center">git配置文件，指定非文本文件的对比合并方式</td>
</tr>
<tr>
<td>.gitignore</td>
<td style="text-align:center">git配置文件，用于忽略你不想提交到Git上的文件</td>
</tr>
<tr>
<td>.watchmanconfig</td>
<td style="text-align:center">watchman的配置文件，watchman用于监控文件变化，辅助实现工程修改信息</td>
</tr>
</tbody>
</table>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-01-13T15:29:13.895Z" itemprop="dateUpdated">2020-01-13 23:29:13</time>
</span><br>


        
        谢谢浏览，我会继续努力的，示例：<a href="/2019/08/22/从无到有跑一个react-native/" target="_blank" rel="external">http://yoursite.com/2019/08/22/从无到有跑一个react-native/</a>
        
    </div>
    <footer>
        <a href="http://yoursite.com">
            <img src="/img/avatar.jpg" alt="BingZhenhuang">
            BingZhenhuang
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-Studio/">Android Studio</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JDK/">JDK</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Node/">Node</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python2/">Python2</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/react-native/">react-native</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/&title=《react-native》 — 小方块 - hhardyy.com&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/&title=《react-native》 — 小方块 - hhardyy.com&source=因为最近老大突然提到了原生app开发，所以我。。。
" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2019/08/22/从无到有跑一个react-native/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《react-native》 — 小方块 - hhardyy.com&url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2019/08/31/vue-echarts-vant-demo/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">Vue+echarts+vant demo</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2019/08/04/JavaScript常见设计模式/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">JavaScript常见设计模式</h4>
      </a>
    </div>
  
</nav>



    














</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        🤠 请我喝可乐！
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content" style="width:50%">
        
        <div class="reward-code" style="text-align:center">
            <div style="width:300px;margin:0px auto;">
               <img id="rewardCode" style="width:50%;height:60%;display:block; margin:0px auto;" src="/img/alipay.jpg" alt="支付宝打赏二维码">
               <span style="display:inline-block; margin-bottom:20px;">0.88(支付宝 aliPay)</span>
               <img id="rewardCode" style="width:50%;height:60%;display:block; margin:0px auto;" src="/img/wechat.jpg" alt="微信打赏二维码">
               <span style="display:inline-block;">0.88(微信 weChat)</span>
            </div>
        </div>
    </div>
</div>



</div>

        <script>
!function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e<d.length;e++)d[e].alpha<=0?(t.body.removeChild(d[e].el),d.splice(e,1)):(d[e].y--,d[e].scale+=.004,d[e].alpha-=.013,d[e].el.style.cssText="left:"+d[e].x+"px;top:"+d[e].y+"px;opacity:"+d[e].alpha+";transform:scale("+d[e].scale+","+d[e].scale+") rotate(45deg);background:"+d[e].color+";z-index:99999");requestAnimationFrame(r)}function o(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),i(e)}}function i(e){var a=t.createElement("div");a.className="heart",d.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:s()}),t.body.appendChild(a)}function c(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}function s(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var d=[];e.requestAnimationFrame=function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)}}(),n()}(window,document);
</script>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script>
    function secondToDate(second) {
        if (!second) {
            return 0;
        }
        var time = new Array(0, 0, 0, 0, 0);
        if (second >= 365 * 24 * 3600) {
            time[0] = parseInt(second / (365 * 24 * 3600));
            second %= 365 * 24 * 3600;
        }
        if (second >= 24 * 3600) {
            time[1] = parseInt(second / (24 * 3600));
            second %= 24 * 3600;
        }
        if (second >= 3600) {
            time[2] = parseInt(second / 3600);
            second %= 3600;
        }
        if (second >= 60) {
            time[3] = parseInt(second / 60);
            second %= 60;
        }
        if (second > 0) {
            time[4] = second;
        }
        return time;
    }</script>
<script type="text/javascript" language="javascript">
    function setTime() {
        var create_time = Math.round(new Date(Date.UTC(2017, 08, 18, 11, 42, 23)).getTime() / 1000);
        var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
        currentTime = secondToDate((timestamp - create_time));
        currentTimeHtml = 'Running：' + currentTime[0] + '年 ' + currentTime[1] + '天 '
                + currentTime[2] + '时 ' + currentTime[3] + '分 ' + currentTime[4]
                + '秒';
        document.getElementById("htmer_time").innerHTML = currentTimeHtml;
    }    setInterval(setTime, 1000);
</script>
<footer class="footer">
    <div class="top">
        

        <p>
          <span id="busuanzi_container_page_pv">
             [&nbsp;浏览量：&nbsp;<span id="busuanzi_value_page_pv"></span>&nbsp;]
          </span>
        </p>
    </div>
    <div class="bottom">
        <p>
        <span>BingZhenhuang &copy; 2017 - 2020</span>
            <span>
                
                Power by <a href="https://hhardyy.github.io/" target="_blank">zhen On August 8</a> 
            </span>
            <span id="htmer_time" "></span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/&title=《react-native》 — 小方块 - hhardyy.com&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/&title=《react-native》 — 小方块 - hhardyy.com&source=因为最近老大突然提到了原生app开发，所以我。。。
" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2019/08/22/从无到有跑一个react-native/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《react-native》 — 小方块 - hhardyy.com&url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2019/08/22/从无到有跑一个react-native/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>








<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '(•‾̑⌣‾̑•)✧˖°回来看我';
            clearTimeout(titleTime);
        } else {
            document.title = '(゜-゜)つロ欢迎回来';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
